<!--
  ~ This program is part of the OpenLMIS logistics management information system platform software.
  ~  Copyright © 2013 VillageReach
  ~
  ~   This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~   This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~   You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org.
  -->
<ng-include
  src="'/public/pages/logistics/distribution/partials/record-facility-data.html'"></ng-include>
<div class="clearfix facility-container">
  <ng-include
    src="'/public/pages/logistics/distribution/partials/record-facility-menu.html'"></ng-include>

  <div class="facility-info" ng-init="facilityData = distribution.facilityDistributions[selectedFacilityId]">
    <div id="coverageContainer" class="refrigerator-container" disable-form="{{facilityData.isDisabled()}}">
      <h3 id="coverageHeader" openlmis-message="label.coverage.full"></h3>

      <div id="coverageTable" class="facility-distribution-form-table" disable-form="{{facilityData.isDisabled()}}">
        <div id="applyNRContainer" class="clearfix">
          <input id="CoverageFormApplyNRToAll" type="button" ng-click="applyNRAll()"
                 class="pull-right btn"
                 openlmis-message="button.apply.nr.all"/>
        </div>
        <form auto-save="distribution" object-store="distributions">
          <table class="table table-bordered">
            <thead>
            <tr>
              <th class="col-complete-vaccinated" id="completeVaccinatedHeader"
                  openlmis-message="label.coverage.complete.vaccinated"></th>
              <th class="col-health-center" id="healthCenterHeader"
                  openlmis-message="label.coverage.health.center"></th>
              <th class="col-mobile-brigade" id="mobileBrigadeHeader"
                  openlmis-message="label.coverage.outreach"></th>
            </tr>
            </thead>
            <tdata>
              <tr>
                <td id="femaleHeader" openlmis-message="label.coverage.females"></td>
                <td class="col-health-center">
                  <div>
                    <span class="position-relative">
                      <input id="femaleHealthCenter" type="number"
                             ng-model="facilityData.fullCoverage.femaleHealthCenterReading.value"
                             name="coverageFemaleHC" ng-trim=false
                             numeric-validator="positiveInteger,7" min="0" max="9999999" step="1"
                             error-holder="coverageFemaleHCError"
                             ng-class="{'required-error': !(facilityData.fullCoverage.femaleHealthCenterReading.value.hasValue() ||
                             facilityData.fullCoverage.femaleHealthCenterReading.notRecorded)}"/>
                      <span id="coverageFemaleHCError"
                            class="rnr-form-error"
                            openlmis-message="error.number.only"
                            style="display: none"></span>
                    </span>
                  </div>
                  <input id="coverageFemaleHC" type="checkbox"
                         ng-model="facilityData.fullCoverage.femaleHealthCenterReading.notRecorded"
                         not-recorded/>
                  <label class="checkbox-label"
                         for="coverageFemaleHC"
                         openlmis-message="label.not.recorded"></label>
                <td class="col-mobile-brigade">
                  <div>
                    <span class="position-relative">
                      <input id="femaleMobileBrigade" type="number"
                             ng-model="facilityData.fullCoverage.femaleMobileBrigadeReading.value"
                             name="coverageFemaleMB" ng-trim=false
                             numeric-validator="positiveInteger,7" min="0" max="9999999" step="1"
                             error-holder="coverageFemaleMBError"
                             ng-class="{'required-error': !(facilityData.fullCoverage.femaleMobileBrigadeReading.value.hasValue() ||
                             facilityData.fullCoverage.femaleMobileBrigadeReading.notRecorded)}"/>
                      <span id="coverageFemaleMBError"
                            class="rnr-form-error"
                            openlmis-message="error.number.only"
                            style="display: none"></span>
                    </span>
                  </div>
                  <input id="coverageFemaleMB" type="checkbox"
                         ng-model="facilityData.fullCoverage.femaleMobileBrigadeReading.notRecorded"
                         not-recorded/>
                  <label class="checkbox-label"
                         for="coverageFemaleMB"
                         openlmis-message="label.not.recorded"></label>
                </td>
              </tr>
              <tr>
                <td id="maleHeader" openlmis-message="label.coverage.males"></td>
                <td class="col-health-center">
                  <div>
                    <span class="position-relative">
                      <input id="maleHealthCenter" type="number"
                             ng-model="facilityData.fullCoverage.maleHealthCenterReading.value"
                             name="coverageMaleHC" ng-trim=false
                             numeric-validator="positiveInteger,7" min="0" max="9999999" step="1"
                             error-holder="coverageMaleHCError"
                             ng-class="{'required-error': !(facilityData.fullCoverage.maleHealthCenterReading.value.hasValue() ||
                             facilityData.fullCoverage.maleHealthCenterReading.notRecorded)}"/>
                      <span id="coverageMaleHCError"
                            class="rnr-form-error"
                            openlmis-message="error.number.only"
                            style="display: none"></span>
                    </span>
                  </div>
                  <input id="coverageMaleHC" type="checkbox"
                         ng-model="facilityData.fullCoverage.maleHealthCenterReading.notRecorded"
                         not-recorded/>
                  <label class="checkbox-label"
                         for="coverageMaleHC"
                         openlmis-message="label.not.recorded"></label>
                <td class="col-health-center">
                  <div>
                    <span class="position-relative">
                      <input id="maleMobileBrigade" type="number"
                             ng-model="facilityData.fullCoverage.maleMobileBrigadeReading.value"
                             name="coverageMaleMB" ng-trim=false
                             numeric-validator="positiveInteger,7" min="0" max="9999999" step="1"
                             error-holder="coverageMaleMBError"
                             ng-class="{'required-error': !(facilityData.fullCoverage.maleMobileBrigadeReading.value.hasValue() ||
                             facilityData.fullCoverage.maleMobileBrigadeReading.notRecorded)}"/>
                      <span id="coverageMaleMBError"
                            class="rnr-form-error"
                            openlmis-message="error.number.only"
                            style="display: none"></span>
                    </span>
                  </div>
                  <input id="coverageMaleMB" type="checkbox"
                         ng-model="facilityData.fullCoverage.maleMobileBrigadeReading.notRecorded"
                         not-recorded/>
                  <label class="checkbox-label"
                         for="coverageMaleMB"
                         openlmis-message="label.not.recorded"></label>
                </td>
              </tr>
              </tr>
            </tdata>
          </table>
        </form>
      </div>
    </div>
  </div>
</div>
